package com.wisely.highlight_spring4.ch2.event;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
/**
 * 事件发布类
 * @author dell
 *
 */
@Component
public class DemoPublisher {
	@Autowired
	ApplicationContext applicationContext;  //注入ApplicationContext 用来发布事件
	
	public void publisher(String msg){
		applicationContext.publishEvent(new DemoEvent(msg));
	}
}
